Skip to content

Make UserProfileCalendar event blocks routable#8371

Merged
dartajax merged 3 commits intoilios:masterfrom
michaelchadwick:frontend-4295-make-user-profile-cal-events-routable
Mar 11, 2026
Merged

Make UserProfileCalendar event blocks routable#8371
dartajax merged 3 commits intoilios:masterfrom
michaelchadwick:frontend-4295-make-user-profile-cal-events-routable

Conversation

@michaelchadwick
Copy link
Contributor

@michaelchadwick michaelchadwick commented Feb 19, 2025

Fixes ilios/ilios#4295

Clicking on an event in the calendar does nothing, but clicking on an event when on the Dashboard::Calendar component routes the user to an event detail, so I changed it so they work the same way by converting a UserEvent into a SchoolEvent.

@michaelchadwick
Copy link
Contributor Author

@dartajax Needs some discussion over the issue I found that events not connected to the current logged in user (e.g. demo_dev1 looking at non-demo_dev1 events) go to a 404 Event Not Found page instead of the expected event detail page.

@dartajax dartajax self-requested a review April 10, 2025 16:56
@dartajax
Copy link
Member

@dartajax Needs some discussion over the issue I found that events not connected to the current logged in user (e.g. demo_dev1 looking at non-demo_dev1 events) go to a 404 Event Not Found page instead of the expected event detail page.

I think my gut instinct on this one was that a user like demo_dev1 and basically any user who has access to the admin console would have enough permissions to be routed to the event.

@jrjohnson
Copy link
Member

This may prove tricky because it's not an event for the user. The event detail routes expect to know and load the current user unless the event it a school event. Wondering if we change the way we load events on this calendar to load all school events and the filter for the user we're interested in. Or something else complicated.

@michaelchadwick michaelchadwick force-pushed the frontend-4295-make-user-profile-cal-events-routable branch from 3e87ed1 to c72b0e2 Compare April 14, 2025 21:42
@netlify
Copy link

netlify bot commented Apr 14, 2025

Deploy Preview for ilios-frontend ready!

Name Link
🔨 Latest commit b57314e
🔍 Latest deploy log https://app.netlify.com/projects/ilios-frontend/deploys/69af200744c17f0008b8e914
😎 Deploy Preview https://deploy-preview-8371--ilios-frontend.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@michaelchadwick michaelchadwick marked this pull request as draft April 17, 2025 16:40
@michaelchadwick michaelchadwick force-pushed the frontend-4295-make-user-profile-cal-events-routable branch 2 times, most recently from 7f4466e to b49955a Compare May 21, 2025 18:39
@michaelchadwick michaelchadwick force-pushed the frontend-4295-make-user-profile-cal-events-routable branch from 041495b to 5aa306c Compare October 14, 2025 20:22
@michaelchadwick michaelchadwick marked this pull request as ready for review October 14, 2025 20:45
@michaelchadwick
Copy link
Contributor Author

@dartajax Upon further reflection, I'm not sure if there's any issue with this one. That being said, I need someone else to test it and let me know if something odd happens, and you're the person for the job, Dave.

@dartajax
Copy link
Member

not sure how I feel about this one -- I am logged in as Nicholas Gutierrez who has permissions to see anything as that user is a user with many permissions indeed

as Nicholas, I look up the student learner "demo_student28" in the Admin Console and click to view this user's calendar - the events can now be clicked upon but always I "demo_dev1" end up with something like the following after clicking ...

See image comments below ...

image

Why would power user demo_dev1 not have access to this event? Better just close the whole thing probably and leave the events not clickable I guess or ...?

@dartajax
Copy link
Member

Logged in as the same user, I can go to Event Detail for anything on the Calendar - I was thinking when I wrote this ticket that the same thing could and / or should happen in Calendar on Admin Console but if it's not feasible, I guess we'd just have to close this?

@michaelchadwick
Copy link
Contributor Author

@dartajax This is definitely a more involved fix than I thought, so will need to ponder further action. That being said, I made a separate PR just for remembering the hide/show calendar toggle: #8891

@jrjohnson
Copy link
Member

I think what you'd need to do is extract the information from the event slug and load the offering and other data needed to create a school event slug, then you could route to the single event page for a school event. It's not a permission issue, it is that we only load user events that belong directly to the user, for seeing the details of an event (as you would on the school calendar) you need a slightly different format. Then permissions matter.

That doesn't really make sense even to me. When you want to dig into this @michaelchadwick let's pair for a bit.

@michaelchadwick michaelchadwick marked this pull request as draft October 15, 2025 16:28
@jrjohnson
Copy link
Member

This may be helped a bit by #8959, now the schoolEvent factory exists to create the event and make it more clickable.

@michaelchadwick
Copy link
Contributor Author

Need to convert the User event to a School event

@michaelchadwick michaelchadwick force-pushed the frontend-4295-make-user-profile-cal-events-routable branch from 5aa306c to 7fa53f4 Compare March 4, 2026 01:31
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

✅ Visual Diff Approved

❌ Visual Diff Report — FAILED

768 images compared: 383 different · 385 identical

Details

Differences (383)

File Diff % Notes
desktop-Acceptance _ Course - Cohorts _ manage cohorts _ .png 100.00% ⚠️ Dimension mismatch (1050x1000 → 1030x1000)
desktop-Acceptance _ Course - Competencies _ collapsed competencies renders _ .png 100.00% ⚠️ Dimension mismatch (1146x1000 → 1122x1000)
desktop-Acceptance _ Course - Leadership _ collapsed leadership _ .png 100.00% ⚠️ Dimension mismatch (1376x1000 → 1341x1000)
desktop-Acceptance _ Course - Leadership _ list leadership _ .png 100.00% ⚠️ Dimension mismatch (1278x1000 → 1248x1000)
desktop-Acceptance _ Course - Learning Materials _ list double linked learning materials _ .png 100.00% ⚠️ Dimension mismatch (1280x1000 → 1249x1000)
desktop-Acceptance _ Course - Multiple Objective Parents _ initial view _ .png 100.00% ⚠️ Dimension mismatch (1116x1000 → 1092x1000)
desktop-Acceptance _ Course - Objective List _ list objectives _ .png 100.00% ⚠️ Dimension mismatch (729x1000 → 718x1000)
desktop-Acceptance _ Course - Objective List _ long objective _ .png 100.00% ⚠️ Dimension mismatch (1057x1000 → 1035x1000)
desktop-Acceptance _ Course - Objective Mesh Descriptors _ cancel changes _ default background color.png 100.00% ⚠️ Dimension mismatch (1028x1000 → 1007x1000)
desktop-Acceptance _ Course - Objective Mesh Descriptors _ cancel changes _ managed background color.png 100.00% ⚠️ Dimension mismatch (994x1000 → 975x1000)
desktop-Acceptance _ Course - Objective Mesh Descriptors _ manage terms _ default background color.png 100.00% ⚠️ Dimension mismatch (1028x1000 → 1007x1000)
desktop-Acceptance _ Course - Objective Mesh Descriptors _ manage terms _ managed background color.png 100.00% ⚠️ Dimension mismatch (994x1000 → 975x1000)
desktop-Acceptance _ Course - Objective Mesh Descriptors _ save terms _ default background color.png 100.00% ⚠️ Dimension mismatch (1028x1000 → 1007x1000)
desktop-Acceptance _ Course - Objective Mesh Descriptors _ save terms _ managed background color.png 100.00% ⚠️ Dimension mismatch (994x1000 → 975x1000)
desktop-Acceptance _ Course - Objective Parents _ cancel changes _ default background color.png 100.00% ⚠️ Dimension mismatch (1061x1000 → 1041x1000)
desktop-Acceptance _ Course - Objective Parents _ cancel changes _ managed background color.png 100.00% ⚠️ Dimension mismatch (918x1000 → 901x1000)
desktop-Acceptance _ Course - Objective Parents _ save changes _ objective list.png 100.00% ⚠️ Dimension mismatch (1061x1000 → 1041x1000)
desktop-Acceptance _ Course - Objective Parents _ save changes _ objective manager.png 100.00% ⚠️ Dimension mismatch (918x1000 → 901x1000)
desktop-Acceptance _ Course - Objective Parents - Faded Status Sync _ objective description and parent objectives faded statuses are synced _ 1st objective list item collapsed again.png 100.00% ⚠️ Dimension mismatch (694x1000 → 685x1000)
desktop-Acceptance _ Course - Objective Parents - Faded Status Sync _ objective description and parent objectives faded statuses are synced _ 1st objective list item collapsed.png 100.00% ⚠️ Dimension mismatch (694x1000 → 685x1000)
desktop-Acceptance _ Course - Objective Parents - Faded Status Sync _ objective description and parent objectives faded statuses are synced _ 1st objective list item expanded.png 100.00% ⚠️ Dimension mismatch (556x1000 → 550x1000)
desktop-Acceptance _ Course - Objective Parents - Faded Status Sync _ objective description and parent objectives faded statuses are synced _ 2nd objective list item collapsed again.png 100.00% ⚠️ Dimension mismatch (694x1000 → 685x1000)
desktop-Acceptance _ Course - Objective Parents - Faded Status Sync _ objective description and parent objectives faded statuses are synced _ 2nd objective list item collapsed.png 100.00% ⚠️ Dimension mismatch (694x1000 → 685x1000)
desktop-Acceptance _ Course - Objective Parents - Faded Status Sync _ objective description and parent objectives faded statuses are synced _ 2nd objective list item expanded.png 100.00% ⚠️ Dimension mismatch (445x1000 → 441x1000)
desktop-Acceptance _ Course - Objective Parents - Faded Status Sync _ objective description and parent objectives faded statuses are synced _ 3rd objective list item collapsed again.png 100.00% ⚠️ Dimension mismatch (694x1000 → 685x1000)
… and 358 more

Download the results.

@michaelchadwick michaelchadwick marked this pull request as ready for review March 4, 2026 16:26
@jrjohnson jrjohnson removed the request for review from stopfstedt March 4, 2026 18:54
Copy link
Member

@jrjohnson jrjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great, huge fan. Would constructing the click event in selectEvent where it is used would work instead of passing isUserProfileCalendar down?

@michaelchadwick michaelchadwick force-pushed the frontend-4295-make-user-profile-cal-events-routable branch from 7fa53f4 to b57314e Compare March 9, 2026 19:31
@michaelchadwick
Copy link
Contributor Author

@jrjohnson I looked into selectEvent, and you're right that it would be better and more localized, but the rewrite would be non-trivial, so I think doing that in a followup would be best.

Copy link
Member

@dartajax dartajax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be working as intended - great job

@dartajax dartajax added the approve visual diff Manually Approve the Results of a Visual Diff Run label Mar 11, 2026
@dartajax dartajax enabled auto-merge March 11, 2026 00:00
@dartajax dartajax merged commit 44a44ec into ilios:master Mar 11, 2026
47 of 48 checks passed
@michaelchadwick
Copy link
Contributor Author

NTS: make a followup to better handle this without the isUserProfileCalendar flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approve visual diff Manually Approve the Results of a Visual Diff Run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clicking On User Calendar Events in Admin Console Need to go to Event Detail

3 participants